package java44th.group.controller.admin.config;

import java44th.group.bean.admin.bo.config.AdminExpressConfigPO;
import java44th.group.bean.admin.bo.config.AdminOrderConfigPO;
import java44th.group.bean.admin.bo.config.AdminWxConfigPO;
import java44th.group.bean.admin.vo.BaseRespVo;
import java44th.group.bean.admin.vo.config.AdminMallConfigVO;
import java44th.group.service.admin.config.AdminConfigService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @projectName: project-second
 * @package: java44th.group.controller.admin.config
 * @className: AdminConfigController
 * @author: 杨浩祥
 * @description: TODO
 * @date: 2022/10/12 23:36
 * @version: 1.0
 */
@RestController
@RequestMapping("admin/config")
public class AdminConfigController {

    @Autowired
    AdminConfigService configService;
    @RequiresPermissions("*")
    @GetMapping("mall")
    public BaseRespVo mallGet(){
        BaseRespVo baseRespVo = configService.mallGet();
        return baseRespVo;
    }
    @RequiresPermissions("*")
    @PostMapping("mall")
    public BaseRespVo mallPost(@RequestBody AdminMallConfigVO adminMallConfigVO){
        BaseRespVo baseRespVo = configService.mallPost(adminMallConfigVO);
        return baseRespVo;
    }
    @RequiresPermissions("*")
    @GetMapping("express")
    public BaseRespVo expressGet(){
        // {"errno":0,"data":{"market_express_freight_min":"5000","market_express_freight_value":"50"},"errmsg":"成功"}
        BaseRespVo baseRespVo = configService.expressGet();
        return baseRespVo;
    }
    @RequiresPermissions("*")
    @PostMapping("express")
    public BaseRespVo expressPost(@RequestBody AdminExpressConfigPO adminExpressConfigPO){
        // {"errno":0,"data":{"market_express_freight_min":"5000","market_express_freight_value":"50"},"errmsg":"成功"}
        BaseRespVo baseRespVo = configService.expressPost(adminExpressConfigPO);
        return baseRespVo;
    }
    @RequiresPermissions("*")
    @GetMapping("order")
    public BaseRespVo orderGet(){
        // {"errno":0,"data":{"market_order_unconfirm":"10","market_order_unpaid":"20","market_order_comment":"18"},"errmsg":"成功"}

        BaseRespVo baseRespVo = configService.orderGet();
        return baseRespVo;
    }
    @RequiresPermissions("*")
    @PostMapping("order")
    public BaseRespVo orderPost(@RequestBody AdminOrderConfigPO adminOrderConfigPO){
        // {"errno":0,"data":{"market_order_unconfirm":"10","market_order_unpaid":"20","market_order_comment":"18"},"errmsg":"成功"}

        BaseRespVo baseRespVo = configService.orderPost(adminOrderConfigPO);
        return baseRespVo;
    }
    @RequiresPermissions("*")
    @GetMapping("wx")
    public BaseRespVo wxGet(){
        // {"errno":0,"data":{"market_wx_index_new":"4","market_wx_index_topic":"5","market_wx_share":"true","market_wx_index_brand":"4","market_wx_catlog_goods":"3","market_wx_catlog_list":"8","market_wx_index_hot":"4"},"errmsg":"成功"}
        BaseRespVo baseRespVo = configService.wxGet();
        return baseRespVo;
    }
    @RequiresPermissions("*")
    @PostMapping("wx")
    public BaseRespVo wxPost(@RequestBody AdminWxConfigPO adminWxConfigPO){
        // {"errno":0,"data":{"market_wx_index_new":"4","market_wx_index_topic":"5","market_wx_share":"true","market_wx_index_brand":"4","market_wx_catlog_goods":"3","market_wx_catlog_list":"8","market_wx_index_hot":"4"},"errmsg":"成功"}
        BaseRespVo baseRespVo = configService.wxPost(adminWxConfigPO);
        return baseRespVo;
    }

}
